<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2025/5/31
  Time: 20:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>我的发布</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link type="text/css" rel="stylesheet" href="css/base.css">
    <link type="text/css" rel="stylesheet" href="css/common.css">
    <link type="text/css" rel="stylesheet" href="css/index.css">
    <script type="text/javascript" src="js/index.js" defer></script>
</head>
<body>

<jsp:include page="header.jsp">
    <jsp:param name="flag" value="4"/>
</jsp:include>

<div class="container history-goods-publish">
    <div class="tabs">
        <div class="tab"><a href="/history_goods_publish?is_removed"></a>全部</div>
        <div class="tab"><a href="/history_goods_publish?is_removed=0">在售商品</a></div>
        <div class="tab"><a href="/history_goods_publish?is_removed=1">已下架商品</a></div>
    </div>
    <div class="history-goods-list">
        <c:forEach items="${publishGoodsList}" var="g">

            <div class="history-goods-card">
                <img class="history-goods-img" src="${pageContext.request.contextPath }${g.image1}" alt="商品名称">
                <div class="history-goods-info">
                    <div class="history-goods-name">${g.name}</div>
                    <div class="history-goods-intor">
                        <span class="history-goods-price">￥${g.price}</span>
<%--                        <span class="history-goods-time">发布时间：2025-05-12 18:06:50</span>--%>
<%--                        <span class="history-goods-time">发布时间：${g.creat_time}</span>--%>
                    </div>
                </div>
                <div class="goods-actions">
<%--                    <span class="btn-action btn-off">已下架</span>--%>

                <td class="table-actions">
                    <c:choose>
                        <c:when test="${g.is_removed=='false'}"><button class="btn-action btn-down" onclick="location.href='/goods_off?id=${g.id}'">下架</button></c:when>
                        <c:otherwise><span class="btn-action btn-off">已下架</span></c:otherwise>
                    </c:choose>
                    <button class="btn-action btn-delete" onclick="location.href='/goods_delete?id=${g.id}'">删除</button>
                </td>
                </div>
            </div>
        </c:forEach>
    </div>
</div>

</body>
</html>
